package com.ssh.util;

import java.io.File;
import java.io.IOException;

import org.apache.commons.io.FileUtils;

public class UploadFileUtil {

	public static boolean save(File file, String fileName, String savePath){
		if (file != null) {
			File savefile = new File(savePath,fileName);
			if (!savefile.getParentFile().exists())
				savefile.getParentFile().mkdirs();
			try {
				FileUtils.copyFile(file, savefile);
			} catch (IOException e) {
				e.printStackTrace();
				return false;
			}
		}
		return true;
	}
}
